<!--
 * @Description: 
 * @Autor: zhangzhanhua
 * @Date: 2021-05-13 15:26:15
 * @LastEditors: zhangzhanhua
 * @LastEditTime: 2021-09-26 18:00:03
-->
<!-- 帆软BI及报表展示 -->
<template>
    <div class="link-home">
        <div id="iframe-container">
            <iframe :src="link" scrolling="auto" frameborder="0" id="iframe"></iframe>
        </div>
    </div>
</template>

<script>
//import NProgress from 'nprogress'

export default {
    data() {
        return {
            title: "",
            link: "",
        }
    },
    mounted() {
        this.initData();
    },
    watch: {
        $route: function (to) {
            this.initData()
        }

    },
    methods: {
        initData() {
            const TOKEN = window.sessionStorage.getItem('token')
            this.title = this.$route.meta.title;
            let link = this.$route.meta.link;
            if (this.title == "天网智慧平台") {
                this.link = link + "?token=" + TOKEN
                return
            }
            if (this.title == '金港专检报表分析' || this.title == '大港专检报表分析' || this.title == '东港专检报表分析' || this.title == '高新港务专检报表分析') {
                this.link = link + "&token=" +  TOKEN
                return
            }
            this.link = link
        }
    }
}
</script>
<style lang="less" scoped>
.link-home {
    width: 100%;
    height: 100%;
}
#iframe-container {
    width: 100%;
    height: 100%;
}
#iframe {
    width: 100%;
    height: 100%;
}
</style>